The present invention relates a method of inquiry of a database system, particularly to such method that is useful for high-speed processing of a plurality of concurrent transactions.
Online transaction systems are widely used for such processing that a plurality of concurrent requests for processing are to be accepted, for example, bank account processing and airline""s processing for airline ticket booking.
The online transaction systems are required to return consistent data even if a plurality of requests occur simultaneously. For example, suppose that a part of a database is being read by the request of a user (first user), while another user (second user) issues a request to update the same data part. In this case, the data to be read by the request from the first user must be read before being updated by the request from the second user. If the data update by the request from the second user is executed when the request is accepted, there is a possibility of the data being rewritten before being read by the request from the first user. Therefore, the system locks the data to be read by the read request from the first user when it accepts this request and lets the data update request from another user waiting until the completion of the data reading by the request from the first user.
Actions to be executed by request from users are called transactions. The online transaction system controls the transactions to avoid contention between the transactions and reading or writing of inconsistent data. The above-mentioned online transaction processing method based on the conventional art poses some problem. If rather long processing time is required for data reading by the request from the first user as, for example, sizable data is read, the data write by the request from the second user must be let waiting until the completion of the data reading by the request from the firs user. Consequently, it takes considerable time to process the request form the second user.
To solve such problem, some database management systems (hereinafter abbreviated to DBMS) use a technique called multi-versioning. Explanation about the multi-versioning is found in a reference, for example, ORACLE8Architecture (Shoeisha) p. 206. This technique permits the data write by the request from the second user to be executed even before the completion of data reading by the request from the first user. If it is required that data of the request from the first user be read from the area where data has been written by the request from the second user, the old data prior to the time when the data write was executed by the request from the second user is recovered by using the rollback segments of the database and transferred to the first user. This processing method eliminates the problem that the processing of one transaction interferes with the processing of another transaction.
The previous technique stated above makes it possible to execute a plurality of transactions concurrently by the multi-versioning. However, the DBMS is responsible for performing all operations including data recovery and this increases the load on the host computer, resulting in long processing time for each transaction. In addition, so large area cannot be allocated for rollback segments, which poses a problem that the multi-versioning method is not suitable for sizable data update processing.
An object of the present invention is to provide a method of enabling efficient processing of concurrent transactions without increasing the load on the system when a plurality of requests for processing through the access to same data area are issued simultaneously.
A computer system of the present invention, which is embodied in preferable mode, includes a host computer for executing transaction processing and a storage sub-system connected to the host computer and furnished with a first storage unit where a database to be accessed for transaction processing is stored and a storage control unit that controls the access to the first storage unit, according to the request from the host computer.
When the host computer issues a write request for database update to the disk sub-system, it checks to see whether incomplete processing to read data from the database is in process. If incomplete read processing is in process, the host computer commands the disk sub-system not to write the data into the first storage unit immediately after receiving the write request to be issued and issues the write request to the disk sub-system.
In response to the write request, the disk sub-system stores the data that is eventually to be written into the database into a second storage which is different from the first storage unit and notifies the host computer of processing complete.
After the completion of both incomplete read processing and write processing, the host computer commands the disk sub-system to write the data into the first storage unit. In response to this command, the disk sub-system writes the data that has been written into the second storage unit but not written into the first storage unit into the first storage unit.
In one mode of implementing the invention, the first storage unit and the second storage unit are disk units controlled to contain same duplicated data by the storage control unit. In normal operation state, the host computer specifies the first storage unit when issuing a command to read data from the database and the second storage unit when issuing a command to write data into the database. The storage control unit reflects the data written into the second storage unit in the first storage unit.
When the storage control unit is commanded not to write data into the first storage unit from the host computer, it temporarily stops the reflection of the data written into the second storage unit in the first storage unit. When the storage control unit is commanded to write data into the first storage unit, it copies the unduplicated data from the second storage unit to the first storage unit so that both storage units will contain the same data. In this way, the storage control unit controls the storage units so that the data written into the second unit will be reflected in the first storage unit.
In another mode of implementing the invention, the second storage unit is a cache memory under the control of the storage control unit. When the storage control unit is commanded not to write data into the first storage unit from the host computer, it stores the data to write into the second storage unit in response to a write request that specifies that data is written into the first storage unit, and then notifies the host computer of processing complete. When the storage control unit is commanded to write data into the first storage unit from the host computer, it retrieves the data retained in the second storage unit, but not written into the first storage unit, from the second storage unit and writes it into the first storage unit.
Other and further objects, features and advantages of the invention will appear more fully from the following description.